﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace ConjureBivouac2012.World
{
    public class WorldMap
    {
        private int tileSize;
        private Tile[,] tiles;

        public int WorldWidth;
        public int WorldHeight;

        public WorldMap(int worldWidth, int worldHeight,int tileSize)
        {
            this.WorldWidth = worldWidth;
            this.WorldHeight = worldHeight;

            this.tileSize = tileSize;
            tiles = new Tile[worldWidth / tileSize, worldHeight / tileSize];
            for (int i=0;i<worldWidth/tileSize;i++)
            {
                for (int j = 0; j < worldHeight / tileSize; j++)
                {
                    tiles[i,j] = new Tile(i, j);
                }
            }
        }

        public Tile GetTile(int x, int y)
        {
            return tiles[x,y];
        }

        public Tile GetTile(float x, float y)
        {
            return tiles[(int)x / tileSize,(int)y / tileSize];
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            for (int i = 0; i < tiles.GetLength(0); i++)
            {
                for (int j = 0; j < tiles.GetLength(1); j++)
                {
                }
            }
        }
    }
}
